// 接口,typ与interface非常相似
// type和interface区别 https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces
// 对结构和类型进行约束


interface Animal {
  name: string,
  eat: () => void
}
// 接口可以进行合并
interface Animal {
  age: number
}

// 接口可以像类一样继承
interface Bear extends Animal {
  honey: boolean
}



function CreateBear(params: Bear): Bear {
  return { ...params }
}

CreateBear({ name: '熊二', age: 10, honey: true, eat: () => { } })


